package indi.gao;

/**
 * <p>Description:</p>
 * <p>Copyright: Copyright (c)2019$</p>
 * <p>Company: Tope</p>
 * <P>Created Date :2019$-09$-16$</P>
 * <P>@version 1.0</P>
 */
public class sdf {
    public static void main(String[] args) {
        System.out.println(QuizAwardNum(75.0245, 0, 1, 45));
    }

    private static int QuizAwardNum(Double accurate, int times, int seconds, int correctNumber) {
        int goldNum = 0;
        int minutes = seconds / 60;

        switch ((accurate.intValue()) / 25) {
            case 3://75%-99%
                if (1 == times) {
                    if (minutes < 20) {
                        goldNum = 8 + correctNumber * 2;
                    } else {
                        goldNum = (minutes / 5) * 4 + 2 * correctNumber;
                    }
                } else {//>= 2 的情况
                    if (minutes < 20) {
                        goldNum = 8 + correctNumber;
                    } else {
                        goldNum = (minutes / 5) * 4 + correctNumber;
                    }
                }
                break;
            case 4://100%
                if (1 == times) {
                    if (minutes < 20) {
                        goldNum = 8 + correctNumber * 3;
                    } else {
                        goldNum = (minutes / 5) * 4 + 3 * correctNumber;
                    }
                } else {//>= 2 的情况
                    if (minutes < 20) {
                        goldNum = 8 + correctNumber;
                    } else {
                        goldNum = (minutes / 5) * 4 + correctNumber;
                    }
                }
                break;
            default://0-74%
                goldNum = 0;
        }
        return goldNum;
    }
}
